package com.hqyj.controller;


import com.hqyj.pojo.Paper;
import com.hqyj.pojo.ResultVo;
import com.hqyj.service.IPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2022-09-28
 */
@RestController
@RequestMapping("/paper")
public class PaperController {

    @Autowired
    IPaperService paperService;
    //试卷生成
    @GetMapping("/add")
    public ResultVo add(Paper p){
        return paperService.paperAdd(p);
    }
    //预览试卷
    @GetMapping("/showPaper")
    public ResultVo showPaper(String name){
        return paperService.showPaper(name);
    }
    //查询考试
    @GetMapping("/queryPaperByName")
    public ResultVo queryPaperByName(String name){
        return paperService.queryPaperByName(name);
    }

}

